* lisp/progmodes/elisp-mode.el (eval-last-sexp, eval-defun): Fix thinko
authorStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Feb 2024 22:52:14 +0000 (17:52 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 24 Feb 2024 22:52:14 +0000 (17:52 -0500)
lisp/progmodes/elisp-mode.el

index 4b1f8022f81124fab9f8f2039d2f5131b34c37cc..8a713bd19a2264eec29ae505e77020e03268f88d 100644 (file)
@@ -1630,7 +1630,8 @@ If `eval-expression-debug-on-error' is non-nil, which is the default,
 this command arranges for all errors to enter the debugger."
   (interactive "P")
   (values--store-value
-   (handler-bind ((error (if #'eval-expression--debug #'ignore)))
+   (handler-bind ((error (if eval-expression-debug-on-error
+                             #'eval-expression--debug #'ignore)))
      (elisp--eval-last-sexp eval-last-sexp-arg-internal))))
 
 (defun elisp--eval-defun-1 (form)
@@ -1769,7 +1770,8 @@ which see."
         (defvar edebug-all-defs)
         (eval-defun (not edebug-all-defs)))
        (t
-        (handler-bind ((error (if #'eval-expression--debug #'ignore)))
+        (handler-bind ((error (if eval-expression-debug-on-error
+                                  #'eval-expression--debug #'ignore)))
           (elisp--eval-defun)))))
 
 ;;; ElDoc Support